﻿using System;
using System.Collections.Generic;
using Pay.DTO;
using Pay.TO;

namespace Pay.IService {
	public interface IChargeService {
		/// <summary>
		/// 付款查询
		/// </summary>
		/// <param name="orderQuery"></param>
		/// <returns></returns>
		ChargePage<charge_dto> Get(ChargeQuery orderQuery);
		/// <summary>
		/// 查询付款
		/// </summary>
		/// <param name="id"></param>
		/// <returns></returns>
		charge_dto Get(long id);
		/// <summary>
		/// 查询付款
		/// </summary>
		/// <param name="order_no"></param>
		/// <returns></returns>
		charge_dto Get(string merchant_no, string order_no);
		charge_dto GetByTran(string transactionNo);
		/// <summary>
		/// 扫码支付创建对象
		/// </summary>
		/// <returns>The by native pay.</returns>
		/// <param name="model">Model.</param>
		charge_dto AddByNativePay(native_model model);
        /// <summary>
        /// 拓垦用户升级创建对象
        /// </summary>
        /// <param name="model">Model.</param>
        charge_dto AddByTokenUserUpgradePay(charge_dto dto);
        /// <summary>
        /// 商城支付创建对象
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        charge_dto AddByMallPay(mall_model model);
        /// <summary>
        /// 验证订单信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        void ValidOrder(mall_model model);
        /// <summary>
        /// 快捷支付创建对象，临时交易写入
        /// </summary>
        /// <returns>The by quick pay.</returns>
        /// <param name="model">Model.</param>
        charge_dto AddByQuickPay(quick_pay_model model);

		/// <summary>
		/// 代收
		/// </summary>
		/// <returns>The by quick pay.</returns>
		/// <param name="model">Model.</param>
		/// <param name="status">1－到账成功，2－不确定，3－失败.</param>
		/// <param name="fail">Fail.</param>
		int AddByQuickPay(apply_receive model, int status, string fail);

		/// <summary>
		/// 网关支付创建对象
		/// </summary>
		/// <returns>The by gateway pay.</returns>
		/// <param name="model">Model.</param>
		int AddByGatewayPay(gateway_pay_model model);

		/// <summary>
		/// 代付充值，账务走的不减余额，否则减余额
		/// </summary>
		/// <returns>The outpay.</returns>
		/// <param name="model">Model.</param>
		int RechargeOutpay(recharge_model model);

		/// <summary>
		/// 支付成功，临时交易写入
		/// </summary>
		/// <returns>The suceess.</returns>
		/// <param name="payHtml">临时数据</param>
		/// <param name="transaction_no">Transaction no.</param>
		/// <param name="pay_time">Pay time.</param>
		int PaySuceess(pay_html_dto payHtml, string transaction_no, DateTime? pay_time);

		/// <summary>
		/// 支付失败，临时交易写入
		/// </summary>
		/// <returns>The fail.</returns>
		/// <param name="transaction_no">Transaction no.</param>
		/// <param name="fail">fail.</param>
		int PayFail(pay_html_dto payHtml, string transaction_no, string fail = "");

		/// <summary>
		/// 支付待确认，临时交易写入
		/// </summary>
		/// <returns>The fail.</returns>
		/// <param name="payHtml">fail.</param>
		/// <param name="transaction_no">Transaction no.</param>
		int WaitPay(pay_html_dto payHtml, string transaction_no);

		/// <summary>
		/// 支付失败
		/// </summary>
		/// <returns>The fail.</returns>
		/// <param name="transaction_no">Transaction no.</param>
		/// <param name="fail">fail.</param>
		int PayFail(string merchant_no, string order_no, string transaction_no, string fail = "");

		/// <summary>
		/// 失败或不确定支付转为成功支付
		/// </summary>
		/// <returns>The or un confirm to suceess.</returns>
		/// <param name="merchant_no">merchant no.</param>
		/// <param name="pay_no">Pay no.</param>
		/// <param name="pay_time">Pay time.</param>
		int FailOrUnConfirmToSuceess(string merchant_no, string pay_no, DateTime? pay_time, string transaction_no = "");

		int CloseOrder(long order_id);

		/// <summary>
		/// 自动关闭过期没付款的付款
		/// </summary>
		/// <returns></returns>
		List<charge_dto> CloseOrder();

		/// <summary>
		/// 将T0的没到账的订单转为T1，再重新代付
		/// </summary>
		/// <returns>The abc.</returns>
		/// <param name="list">List.</param>
		int ABC(List<string> list);

		/// <summary>
		/// 重整账单
		/// </summary>
		/// <returns>The acount.</returns>
		int ReAcount();
	}
}
